package com.xiaoke.controller;

import com.xiaoke.domain.ResponseResult;
import com.xiaoke.domain.dto.LoginDto;
import com.xiaoke.service.LoginService;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping( "/admin")
public class LoginController {


    @Resource
    LoginService loginService;

    @PostMapping("/login")
    public ResponseResult login(@RequestBody @Validated LoginDto loginDto) {
        return loginService.login(loginDto);
    }
}
